import request from "@/axios/request.js";
import axios from "axios";
import { head } from "lodash";

//初始化文件上传
export function initFileAPI(data) {
  return request({
    url: "/judge-backend/file/upload/part/init",
    method: "POST",
    params: {
      ...data,
    },
  });
}
//分片上传
export function uploadFileAPI(url, data) {
  return axios({
    url,
    method: "PUT",
    data,
    headers: {
      Authorization: localStorage.getItem("TOKEN"),
    },
  });
}
//合并文件
export function mergeFileAPI(data) {
  return request({
    url: "/judge-backend/file/upload/part/merge",
    method: "GET",
    params: {
      ...data,
    },
  });
}
